package com.ijiuchuang.jc_localization.contract;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.PointF;

import com.ijiuchuang.jc_localization.bean.event.SocketGetInfoEvent;
import com.ijiuchuang.jc_localization.base.BasePresenter;
import com.ijiuchuang.jc_localization.base.BaseView;

import java.util.List;

import rx.functions.Action1;

/**
 * Created by Veev on 2016/6/16
 *
 * @link 384506557@qq.com
 */
public interface LocationContract {

    interface View extends BaseView<Presenter> {
        void socketConnect();

        void updatePos(PointF pointF);
        void updatePos(String mac, String name, PointF pointF);

        void setPoint(List<PointF> list);
        void setMap(Bitmap bitmap);
    }

    interface Presenter extends BasePresenter {
        void socketConnect();

        void onDestroy();

        void locationChanged(SocketGetInfoEvent event);
        void getPoint();

        void loadConfig();
    }

    interface Model {
        interface LocationChangeListener {
            void onChanged(PointF point);
            void onChanged(String mac, String name, PointF point);
        }

        interface DataComingListener {
            void onCame(SocketGetInfoEvent event);
        }

        void socketConnect(DataComingListener listener);

        void locationProcess(SocketGetInfoEvent socketGetInfoEvent, LocationChangeListener listener);

        List<PointF> getPoint();

        void loadMap(Context context, Action1<Bitmap> action1);
    }
}
